##! /bin/bash
#! bash
#
#  $Id: a_traduire.sh 3 2010-05-27 16:25:49Z alistair.mills@btinternet.com $
#
export TARGET='Articles de La Guinguette &agrave; traduire'
export  total=0
. ./defines.sh
cat > $2 <</eof

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
   <head>
      <title>$TARGET</title>
      <link rel="shortcut icon" href="$TARGET.ico" type="image/x-icon">
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
      <link href="../../style.css" rel="stylesheet" type="text/css">
      <script src="sorttable.js" language="JavaScript" type="text/javascript"></script>

      </head>

   <body background="../back.gif" lang="FR">

<a href="index.html"><img src="../../up.gif" alt="up" width="36" height="18"></a>

<h1>Articles de La Guinguette &agrave; traduire </h1>

<p>Cliquer sur le titre d'un colon pour tirer les donn&eacute;es du tableau.</p>

<table class="sortable" border="1">

<thead>
<tr>
<th align="left"><u>Ann&eacute;e</u></th>
<th align="left"><u>Mois</u></th>
<th align="left"><u>Cat&eacute;gorie</u></th>
<th align="left"><u>Taille</u></th>
<th align="left"><u>Title</u></th>
<th align="left"><u>Traduction</u></th>
<th align="left"><u>Article</u></th>
</tr>
</thead>

<tbody>

/eof


### Main script stars here ###
# Store file name  here
FILE=$1
export prepare='<font color="#a0a0a0"> En pr&eacute;paration </font>'
  . ./defines.sh
  . ./keys.sh

while read year mon cat size url key trans line
do

  if [ "$line" != "$title_line" -a "$year" != "$comment_line" ]
  then
      . ./categories.sh
      . ./months.sh
      . ./translators.sh
      export tra=${year}_${mon}_${cat}
      if [ "$line" != "" ]
      then
      export       total=`expr $total + 1`
      export         tot=`printf '%.3i' $total`
        echo $tot - $line
        echo '<tr>'                                                                                         >> $2
        echo '<td>'$year'</td>'                                                                             >> $2
        echo '<td align="right">'$month'</td>'                                                              >> $2
        echo '<td>'$category'</td>'                                                                         >> $2
        echo '<td align="right">'$size'</td>'                                                               >> $2
        echo '<td>'$line'</td>'                                                                             >> $2
        if [ "$key" = "$not_started" ]
        then
            echo '<td align="right">-</td>'                                                                 >> $2
        else
            if [ "$key" = "$in_progress" ]
            then
                echo '<td><a href="'$tra'.html" title="'$line'" target="_blank"> '$prepare' </a></td>'      >> $2
            else
                echo '<td><a href="'$tra'.html" title="'$line'" target="_blank">Cliquer ici </a></td>'      >> $2
            fi
        fi
        echo '<td><a href="'$url'" title="'$line'" target="_blank"> Cliquer ici </a></td>'                  >> $2
        echo '</tr>'                                                                                        >> $2
      fi
  fi
done < $FILE

cat >> $2 <</eof
</tbody>
</table>

<hr>
      <p lang="ENS">With questions or for more information, please contact Alistair Mills <a href="mailto:alistair.mills@btinternet.com"> alistair.mills@btinternet.com</a><br>
      Updated <!-- #BeginDate format:Sw1 --> $date <!-- #EndDate --></p>
      <hr>
      <a href="http://validator.w3.org/check?uri=referer">
        <img
        src="http://www.w3.org/Icons/valid-html401-blue"
        alt="Valid HTML 4.01 Transitional" height="31" width="88">
      </a>
<hr>
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-2273668-1";
urchinTracker();
</script>

      </body>
</html>
/eof

#
#
#
